1. Field of the Invention
2. Description of the Related Art
A computer system typically relies upon its graphics system for producing visual output on a computer screen or display device. Early graphics systems were only responsible for taking what the processor produced as output and displaying it on the screen. In essence, they acted as simple translators or interfaces. Modern graphics systems, however, incorporate graphics processors with a great deal of processing power. The graphics systems now act more like coprocessors rather than simple translators. This change is due to the recent increase in both the complexity and amount of data being sent to the display device. For example, modern computer displays have many more pixels, greater color depth, and are able to display images with higher refresh rates than earlier models. Similarly, the images displayed are now more complex and may involve advanced rendering and visual techniques such as anti-aliasing and texture mapping.
As a result, without considerable processing power in the graphics system, the computer""s system CPU would spend a great deal of time performing graphics calculations. This could rob the computer system of the processing power needed for performing other tasks associated with program execution and thereby dramatically reduce overall system performance. With a powerful graphics system, however, when the CPU is instructed to draw a box on the screen, the CPU is freed from having to compute the position and color of each pixel. Instead, the CPU may send a request to the video card stating: xe2x80x9cdraw a box at these coordinatesxe2x80x9d. The graphics system then draws the box, freeing the CPU to perform other tasks.
Generally, a graphics system in a computer (also referred to as a graphics system) is a type of video adapter that contains its own processor to boost performance levels. These processors are specialized for computing graphical transformations, so they tend to achieve better results than the general-purpose CPU used by the computer system. In addition, they free up the computer""s CPU to execute other commands while the graphics system is handling graphics computations. The popularity of graphical applications, and especially multimedia applications, has made high performance graphics systems a common feature of computer systems. Most computer manufacturers now bundle a high performance graphics system with their systems.
Since graphics systems typically perform only a limited set of functions, they may be customized and therefore far more efficient at graphics operations than the computer""s general-purpose microprocessor. While early graphics systems were limited to performing two-dimensional (2D) graphics, their functionality has increased to support three-dimensional (3D) wire-frame graphics, 3D solids, and now includes support for textures and special effects such as advanced shading, fogging, alpha-blending, and specular highlighting.
The rendering ability of 3D graphics systems has been improving at a breakneck pace. A few years ago, shaded images of simple objects could only be rendered at a few frames per second, but today""s systems support rendering of complex objects at 60 Hz or higher. At this rate of increase, in the not too distant future, graphics systems will literally be able to render more pixels in xe2x80x9creal-timexe2x80x9d than a single human""s visual system can perceive. While this extra performance may be useable in multiple-viewer environments, it may be wasted in the more common single-viewer environments. Thus, a graphics system is desired which is capable of utilizing the increased graphics processing power to generate images that are more realistic.
While the number of pixels and frame rate is important in determining graphics system performance, another factor of equal or greater importance is the visual quality of the image generated. For example, an image with a high pixel density may still appear unrealistic if edges within the image are too sharp or jagged (also referred to as xe2x80x9caliasedxe2x80x9d). One well-known technique to overcome these problems is anti-aliasing. Anti-aliasing involves smoothing the edges of objects by shading pixels along the borders of graphical elements. More specifically, anti-aliasing entails removing higher frequency components from an image before they cause disturbing visual artifacts. For example, anti-aliasing may soften or smooth high contrast edges in an image by forcing certain pixels to intermediate values (e.g., around the silhouette of a bright object superimposed against a dark background).
Another visual effect used to increase the realism of computer images is alpha blending. Alpha blending is a technique that controls the transparency of an object, allowing realistic rendering of translucent surfaces such as water or glass. Another effect used to improve realism is fogging. Fogging obscures an object as it moves away from the viewer. Simple fogging is a special case of alpha blending in which the degree of alpha changes with distance so that the object appears to vanish into a haze as the object moves away from the viewer. This simple fogging may also be referred to as xe2x80x9cdepth cueingxe2x80x9d or atmospheric attenuation, i.e., lowering the contrast of an object so that it appears less prominent as it recedes. More complex types of fogging go beyond a simple linear function to provide more complex relationships between the level of translucence and an object""s distance from the viewer. Current state of the art software systems go even further by utilizing atmospheric models to provide low-lying fog with improved realism.
While the techniques listed above may dramatically improve the appearance of computer graphics images, they also have certain limitations. In particular, they may introduce their own aberrations and are typically limited by the density of pixels displayed on the display device.
As a result, a graphics system is desired which is capable of utilizing increased performance levels to increase not only the number of pixels rendered but also the quality of the image rendered. In addition, a graphics system is desired which is capable of utilizing increases in processing power to improve the results of graphics effects such as anti-aliasing.
Prior art graphics systems have generally fallen short of these goals. Prior art graphics systems use a conventional frame buffer for refreshing pixel/video data on the display. The frame buffer stores rows and columns of pixels that exactly correspond to respective row and column locations on the display. Prior art graphics system render 2D and/or 3D images or objects into the frame buffer in pixel form, and then read the pixels from the frame buffer during a screen refresh to refresh the display. Thus, the frame buffer stores the output pixels that are provided to the display. To reduce visual artifacts that may be created by refreshing the screen at the same time the frame buffer is being updated, most graphics systems"" frame buffers are double-buffered.
To obtain images that are more realistic, some prior art graphics systems have gone further by generating more than one sample per pixel. As used herein, the term xe2x80x9csamplexe2x80x9d refers to calculated color information that indicates the color, depth (z), and potentially other information, of a particular point on an object or image. For example, a sample may comprise the following component values: a red value, a green value, a blue value, a z value, and an alpha value (e.g., representing the transparency of the sample). A sample may also comprise other information, e.g., a z-depth value, a blur value, an intensity value, brighter-than-bright information, and an indicator that the sample consists partially or completely of control information rather than color information (i.e., xe2x80x9csample control informationxe2x80x9d). By calculating more samples than pixels (i.e., super-sampling), a more detailed image is calculated than can be displayed on the display device. For example, a graphics system may calculate four samples for each pixel to be output to the display device. After the samples are calculated, they are then combined or filtered to form the pixels that are stored in the frame buffer and then conveyed to the display device. Using pixels formed in this manner may create a more realistic final image because overly abrupt changes in the image may be smoothed by the filtering process.
These prior art super-sampling systems typically generate a number of samples that are far greater than the number of pixel locations on the display. These prior art systems typically have rendering processors that calculate the samples and store them into a render buffer. Filtering hardware then reads the samples from the render buffer, filters the samples to create pixels, and then stores the pixels in a traditional frame buffer. The traditional frame buffer is typically double-buffered, with one side being used for refreshing the display device while the other side is updated by the filtering hardware. Once the samples have been filtered, the resulting pixels are stored in a traditional frame buffer that is used to refresh to display device. These systems, however, have generally suffered from limitations imposed by the conventional frame buffer and by the added latency caused by the render buffer and filtering. Therefore, an improved graphics system is desired which includes the benefits of pixel super-sampling while avoiding the drawbacks of the conventional frame buffer.
For increased performance, graphics systems may implement multiple pipelines for manipulating the graphics data in parallel. However, managing multiple pipelines is difficult and may be prone to error. Furthermore, it may be required that certain portions of the graphics data are processed in a given order, which further complicates the implementation of parallel pipelines. The multiple parallel pipelines of the graphics system should also remain, to a large degree, transparent to the rest of the computer system, for example the graphics drivers.
A graphics system is therefore desired that can reliably and effectively manage multiple parallel pipelines. Furthermore, the graphics system should be able to reliably manage graphics data that is required to proceed through the graphics system in a given order. In addition, the graphics system should be able to reliably manage graphics data that may be processed out of order.
The present invention comprises a computer graphics system that utilizes a super-sampled sample buffer and one or more programmable sample-to-pixel calculation unit for refreshing the display. In one embodiment, the graphics system may have a graphics processor configured to render (or draw) the samples, a super-sampled sample buffer, and a sample-to-pixel calculation unit.
The graphics processor may generate a plurality of samples (based on a selected set of sample positions) and store the samples into a sample buffer. The graphics processor preferably generates and stores more than one sample for at least a subset of the pixel locations on the display. Thus, the sample buffer is a super-sampled (also referred to as xe2x80x9cover-sampledxe2x80x9d) sample buffer that stores a number of samples that, in some embodiments, may be far greater than the number of pixel locations on the display. In other embodiments, the total number of samples may be closer to, equal to, or even less than the total number of pixel locations on the display device, but the samples may be more densely positioned in certain areas and less densely positioned in other areas.
The sample-to-pixel calculation unit is configured to read the samples from the super-sampled sample buffer and filter or convolve the samples into respective output pixels, wherein the output pixels are then provided to refresh the display. As used herein, the terms xe2x80x9cfilterxe2x80x9d and xe2x80x9cconvolvexe2x80x9d are used interchangeably and refer to mathematically manipulating one or more samples to generate a pixel (e.g., by averaging, by applying a convolution function, by summing, by applying a filtering function, by weighting the samples and then manipulating them, by applying a randomized function, etc.). The sample-to-pixel calculation unit selects one or more samples and filters them to generate an output pixel. The number of samples selected and or filtered by the sample-to-pixel calculation unit may be one or, in the preferred embodiment, greater than one, but this may vary depending upon the exact implementation.
In some embodiments, the number of samples used to form each pixel may vary. For example, the underlying average sample density in the sample buffer may vary, the extent of the filter may vary, and/or the number of samples for a particular pixel may vary due to stochastic variations in the sample density. In some embodiments, the average number of samples contributing to a pixel may vary on a per-pixel basis, on a per-scan line basis, on a per-region basis, on a per-frame basis, or the number may remain constant. The sample-to-pixel calculation unit may access the samples from the super-sampled sample buffer, perform a real-time filtering operation, and then provide the resulting output pixels to the display in real-time. The graphics system may operate without a conventional frame buffer, i.e., the graphics system does not utilize a conventional frame buffer that stores the actual pixel values that are being refreshed on the display. Note some displays may have internal frame buffers, but these are considered an integral part of the display device, not the graphics system. Thus, the sample-to-pixel calculation units may calculate each pixel for each screen refresh xe2x80x9con-the-flyxe2x80x9d. As used herein, the term xe2x80x9con-the-flyxe2x80x9d refers to a function that is performed at or near the display device""s refresh ratexe2x80x9d. For example, filtering samples xe2x80x9con-the-flyxe2x80x9d means calculating enough output pixels at a rate high enough to support the refresh rate of a display device. xe2x80x9cReal-timexe2x80x9d means at, near, or above the human visual system""s perception capabilities for motion fusion (how often a picture must be changed to give the illusion of continuous motion) and flicker fusion (how often light intensity must be changed to give the illusion of continuous). These concepts are further described in the book xe2x80x9cSpatial Visionxe2x80x9d by Russel L. De Valois and Karen K. De Valois, Oxford University Press, 1988.
In one embodiment, in order to process the increasing amount of graphics data, the graphics system may utilize multiple pipelines with multiple rendering units for parallel processing of the graphics data. The graphics system may implement the use of tokens (non-graphics data with special meaning to the units along the pipelines) to maintain the reliable flow of graphics data through the multiple pipelines. In most cases, the order in which graphics data is processed is irrelevant. Hereinafter, such data is referred to as unordered data. Thus, the graphics system may process the graphics data by distributing the data to the multiple pipelines. The plurality of samples generated by the multiple pipelines may be stored in appropriate locations in the sample buffer. However, in certain cases, it may be required that certain graphics data be processed in order. Hereinafter, such data is referred to as ordered data. Special consideration may be given to the treatment of ordered data in a multiple pipeline embodiment to ensure a correct processing order.
Delta-encoded data is an example of ordered data. For example, the position of consecutive vertices (and/or other properties associated therewith) may be coded as a relative distance from the previous vertex (instead of an absolute distance). This may be the case, for example, for compressed graphics data. Such delta-encoded data is preferably processed in order to ensure the proper interpretation of such data.
In one embodiment, a control unit may operate as the interface between the graphics system and the computer system (or the graphics driver) by controlling the transfer of graphics data between the graphics system and the computer system. The control unit may divide the stream of graphics data received by the computer system into a corresponding number of parallel streams that may be routed to individual rendering units (data processors). The rendering units may be configured to receive and process the graphics commands and graphics data provided by the control unit in order to generate a plurality of output samples. In one embodiment, one or more rows of schedule units (data routing unit) may be coupled to the rendering units and may be configured to sequence the computed samples to appropriate locations in the sample memories.
In one embodiment, the control unit may use three types of tokens to control the flow of graphics data through the multiple pipelines: slave stop (S), master stop (M), and master resume (R). Typically, the control unit may distribute incoming graphics data to the available rendering units for parallel processing and thus, faster execution. Parallel processing may be desired in most cases except for the processing of ordered data. In one embodiment, to switch from unordered to ordered data, the control unit may send an S token to all but one rendering unit, and an M token to the rendering unit that is to receive the ordered data.
After all ordered data in a particular sequence has been sent to the designated rendering unit, the control unit may send an R token to the rendering unit processing the ordered data to indicate the end of the ordered data. The rendering units may pass the tokens they receive from the control unit to the schedule units. Following the R token, the graphics system may resume regular processing of unordered data through the multiple pipelines.